package com.telecom.cms.actions;

import java.sql.Connection;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.telecom.cms.dao.SEG_BIZ_GROUP_DEFDAO;
import com.telecom.cms.dao.GetConnect;


/**
 * @author yueyingnishang
 *
 */
public class GetgroupAction extends Action {

	/* (non-Javadoc)
	 * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		int bookmarkid = Integer.parseInt(request.getParameter("bookmarkid"));
		Connection con = GetConnect.getCsConnection();
		SEG_BIZ_GROUP_DEFDAO dao = new SEG_BIZ_GROUP_DEFDAO(con);
		List list = dao.findById(bookmarkid);
		request.getSession().setAttribute("bookmarkid", String.valueOf(bookmarkid));
		request.setAttribute("Group", list);
		return mapping.findForward("success");
	}

}
